package demo.example.exception;

/**
 * @Date 2022/7/13 21:24
 * @Created by wangle
 * @Description 统一异常
 */
public class TTException  extends  RuntimeException{

    private final Integer code;
    private final String message;

    public TTException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public TTException(TTExceptionEnum exceptionEnum) {
        this(exceptionEnum.getCode(), exceptionEnum.getMsg());
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }


}
